package com.txts.road.admin.deviceSys.service.impl;

import com.txts.road.admin.deviceSys.domain.VehicleDevice;
import com.txts.road.admin.deviceSys.mapper.VehicleDeviceMapper;
import com.txts.road.admin.deviceSys.service.IVehicleDeviceService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 车载设备信息Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-15
 */
@Service
public class VehicleDeviceServiceImpl implements IVehicleDeviceService {
    @Resource
    private VehicleDeviceMapper vehicleDeviceMapper;

    /**
     * 查询车载设备信息
     *
     * @param deviceName 车载设备信息主键
     * @return 车载设备信息
     */
    @Override
    public VehicleDevice selectVehicleDeviceByDeviceName(String deviceName) {
        return vehicleDeviceMapper.selectVehicleDeviceByDeviceName(deviceName);
    }

    /**
     * 查询车载设备信息列表
     *
     * @param vehicleDevice 车载设备信息
     * @return 车载设备信息
     */
    @Override
    public List<VehicleDevice> selectVehicleDeviceList(VehicleDevice vehicleDevice) {
        return vehicleDeviceMapper.selectVehicleDeviceList(vehicleDevice);
    }

    /**
     * 新增车载设备信息
     *
     * @param vehicleDevice 车载设备信息
     * @return 结果
     */
    @Override
    public int insertVehicleDevice(VehicleDevice vehicleDevice) {
        return vehicleDeviceMapper.insertVehicleDevice(vehicleDevice);
    }

    /**
     * 修改车载设备信息
     *
     * @param vehicleDevice 车载设备信息
     * @return 结果
     */
    @Override
    public int updateVehicleDevice(VehicleDevice vehicleDevice) {
        return vehicleDeviceMapper.updateVehicleDevice(vehicleDevice);
    }

    /**
     * 批量删除车载设备信息
     *
     * @param deviceNames 需要删除的车载设备信息主键
     * @return 结果
     */
    @Override
    public int deleteVehicleDeviceByDeviceNames(String[] deviceNames) {
        return vehicleDeviceMapper.deleteVehicleDeviceByDeviceNames(deviceNames);
    }

    /**
     * 删除车载设备信息信息
     *
     * @param deviceName 车载设备信息主键
     * @return 结果
     */
    @Override
    public int deleteVehicleDeviceByDeviceName(String deviceName) {
        return vehicleDeviceMapper.deleteVehicleDeviceByDeviceName(deviceName);
    }


    @Override
    public List<String> selectAllshebei() {
        return vehicleDeviceMapper.selectAllshebei();
    }
}
